﻿
/*----------------------------------------------------------------//
// 文件名：MoSampleParameter.cs
// 文件功能描述：实体 MoSampleParameter.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoSampleParameter
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoSampleParameter
    /// </summary>
    public partial class MoSampleParameter : ICloneable
    {
        #region 表SampleParameter的字段
        private string sampleId;
        private string reportId;
        private string refParFile;
        private string model;
        private string exfactoryId;
        private DateTime exfactoryDate;
        private string producer;
        private string consignCorp;
        private string deliverCorp;
        private string techCondition;
        private string testOutline;
        private DateTime regDate;
        private decimal ratedV;
        private decimal ratedA;
        private decimal resistA;
        private decimal apexA;
        private string commissary;
        private DateTime createTime;
        private DateTime updateTime;
        #endregion

        #region 构造函数
        public MoSampleParameter()
        {
            exfactoryDate = new DateTime(1900, 1, 1); regDate = new DateTime(1900, 1, 1); createTime = new DateTime(1900, 1, 1); updateTime = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoSampleParameter(MoSampleParameter item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoSampleParameter(string sampleId, string reportId, string refParFile, string model, string exfactoryId, DateTime exfactoryDate, string producer, string consignCorp, string deliverCorp, string techCondition, string testOutline, DateTime regDate, decimal ratedV, decimal ratedA, decimal resistA, decimal apexA, string commissary, DateTime createTime, DateTime updateTime)
        {
            this.sampleId = sampleId;
            this.reportId = reportId;
            this.refParFile = refParFile;
            this.model = model;
            this.exfactoryId = exfactoryId;
            this.exfactoryDate = exfactoryDate;
            this.producer = producer;
            this.consignCorp = consignCorp;
            this.deliverCorp = deliverCorp;
            this.techCondition = techCondition;
            this.testOutline = testOutline;
            this.regDate = regDate;
            this.ratedV = ratedV;
            this.ratedA = ratedA;
            this.resistA = resistA;
            this.apexA = apexA;
            this.commissary = commissary;
            this.createTime = createTime;
            this.updateTime = updateTime;
        }
        #endregion

        #region 表SampleParameter的字段属性
        /// <summary>
        /// SAMPLE_ID
        /// </summary>
        public string SampleId
        {
            get { return sampleId; }
            set { sampleId = value; }
        }
        /// <summary>
        ///编号规则为NO. LDYYMMXXX，其中NO.LD为固定前缀，YY表示年份，MM代表月份，XXX代表当月第几个报告。XXX为业务组手工录入。此编号不能重复。报告编号做为唯一值编号贯穿于整个系统流程（包括财务、业务、试验、报告等各部门）
        /// </summary>
        public string ReportId
        {
            get { return reportId; }
            set { reportId = value; }
        }
        /// <summary>
        /// REF_PAR_FILE
        /// </summary>
        public string RefParFile
        {
            get { return refParFile; }
            set { refParFile = value; }
        }
        /// <summary>
        /// MODEL
        /// </summary>
        public string Model
        {
            get { return model; }
            set { model = value; }
        }
        /// <summary>
        /// EXFACTORY_ID
        /// </summary>
        public string ExfactoryId
        {
            get { return exfactoryId; }
            set { exfactoryId = value; }
        }
        /// <summary>
        /// EXFACTORY_DATE
        /// </summary>
        public DateTime ExfactoryDate
        {
            get { return exfactoryDate; }
            set { exfactoryDate = value; }
        }
        /// <summary>
        /// PRODUCER
        /// </summary>
        public string Producer
        {
            get { return producer; }
            set { producer = value; }
        }
        /// <summary>
        /// CONSIGN_CORP
        /// </summary>
        public string ConsignCorp
        {
            get { return consignCorp; }
            set { consignCorp = value; }
        }
        /// <summary>
        /// DELIVER_CORP
        /// </summary>
        public string DeliverCorp
        {
            get { return deliverCorp; }
            set { deliverCorp = value; }
        }
        /// <summary>
        /// TECH_CONDITION
        /// </summary>
        public string TechCondition
        {
            get { return techCondition; }
            set { techCondition = value; }
        }
        /// <summary>
        /// TEST_OUTLINE
        /// </summary>
        public string TestOutline
        {
            get { return testOutline; }
            set { testOutline = value; }
        }
        /// <summary>
        /// REG_DATE
        /// </summary>
        public DateTime RegDate
        {
            get { return regDate; }
            set { regDate = value; }
        }
        /// <summary>
        /// RATED_V
        /// </summary>
        public decimal RatedV
        {
            get { return ratedV; }
            set { ratedV = value; }
        }
        /// <summary>
        /// RATED_A
        /// </summary>
        public decimal RatedA
        {
            get { return ratedA; }
            set { ratedA = value; }
        }
        /// <summary>
        /// RESIST_A
        /// </summary>
        public decimal ResistA
        {
            get { return resistA; }
            set { resistA = value; }
        }
        /// <summary>
        /// APEX_A
        /// </summary>
        public decimal ApexA
        {
            get { return apexA; }
            set { apexA = value; }
        }
        /// <summary>
        /// COMMISSARY
        /// </summary>
        public string Commissary
        {
            get { return commissary; }
            set { commissary = value; }
        }
        /// <summary>
        /// CREATE_TIME
        /// </summary>
        public DateTime CreateTime
        {
            get { return createTime; }
            set { createTime = value; }
        }
        /// <summary>
        /// UPDATE_TIME
        /// </summary>
        public DateTime UpdateTime
        {
            get { return updateTime; }
            set { updateTime = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoSampleParameter CopyTo(MoSampleParameter item)
        {
            item.sampleId = this.sampleId;
            item.reportId = this.reportId;
            item.refParFile = this.refParFile;
            item.model = this.model;
            item.exfactoryId = this.exfactoryId;
            item.exfactoryDate = this.exfactoryDate;
            item.producer = this.producer;
            item.consignCorp = this.consignCorp;
            item.deliverCorp = this.deliverCorp;
            item.techCondition = this.techCondition;
            item.testOutline = this.testOutline;
            item.regDate = this.regDate;
            item.ratedV = this.ratedV;
            item.ratedA = this.ratedA;
            item.resistA = this.resistA;
            item.apexA = this.apexA;
            item.commissary = this.commissary;
            item.createTime = this.createTime;
            item.updateTime = this.updateTime;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoSampleParameter mo = new MoSampleParameter();
            mo.SampleId = this.SampleId;
            mo.ReportId = this.ReportId;
            mo.RefParFile = this.RefParFile;
            mo.Model = this.Model;
            mo.ExfactoryId = this.ExfactoryId;
            mo.ExfactoryDate = this.ExfactoryDate;
            mo.Producer = this.Producer;
            mo.ConsignCorp = this.ConsignCorp;
            mo.DeliverCorp = this.DeliverCorp;
            mo.TechCondition = this.TechCondition;
            mo.TestOutline = this.TestOutline;
            mo.RegDate = this.RegDate;
            mo.RatedV = this.RatedV;
            mo.RatedA = this.RatedA;
            mo.ResistA = this.ResistA;
            mo.ApexA = this.ApexA;
            mo.Commissary = this.Commissary;
            mo.CreateTime = this.CreateTime;
            mo.UpdateTime = this.UpdateTime;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoSampleParameter NewSampleParameter = obj as MoSampleParameter;
                if (NewSampleParameter == null)
                {
                    return false;
                }
                else
                {
                    if (NewSampleParameter.SampleId == this.SampleId && NewSampleParameter.ReportId == this.ReportId && NewSampleParameter.RefParFile == this.RefParFile && NewSampleParameter.Model == this.Model && NewSampleParameter.ExfactoryId == this.ExfactoryId && NewSampleParameter.ExfactoryDate == this.ExfactoryDate && NewSampleParameter.Producer == this.Producer && NewSampleParameter.ConsignCorp == this.ConsignCorp && NewSampleParameter.DeliverCorp == this.DeliverCorp && NewSampleParameter.TechCondition == this.TechCondition && NewSampleParameter.TestOutline == this.TestOutline && NewSampleParameter.RegDate == this.RegDate && NewSampleParameter.RatedV == this.RatedV && NewSampleParameter.RatedA == this.RatedA && NewSampleParameter.ResistA == this.ResistA && NewSampleParameter.ApexA == this.ApexA && NewSampleParameter.Commissary == this.Commissary && NewSampleParameter.CreateTime == this.CreateTime && NewSampleParameter.UpdateTime == this.UpdateTime)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "SampleId={0}/ReportId={1}/RefParFile={2}/Model={3}/ExfactoryId={4}/ExfactoryDate={5}/Producer={6}/ConsignCorp={7}/DeliverCorp={8}/TechCondition={9}/TestOutline={10}/RegDate={11}/RatedV={12}/RatedA={13}/ResistA={14}/ApexA={15}/Commissary={16}/CreateTime={17}/UpdateTime={18}", sampleId, reportId, refParFile, model, exfactoryId, exfactoryDate, producer, consignCorp, deliverCorp, techCondition, testOutline, regDate, ratedV, ratedA, resistA, apexA, commissary, createTime, updateTime);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["Sample_ID"] != null && row["Sample_ID"] != DBNull.Value)
            {
                this.SampleId = (string)row["Sample_ID"];
            }
            else
            {
                this.SampleId = string.Empty;
            }
            if (row["Report_ID"] != null && row["Report_ID"] != DBNull.Value)
            {
                this.ReportId = (string)row["Report_ID"];
            }
            else
            {
                this.ReportId = string.Empty;
            }
            if (row["Ref_Par_File"] != null && row["Ref_Par_File"] != DBNull.Value)
            {
                this.RefParFile = (string)row["Ref_Par_File"];
            }
            else
            {
                this.RefParFile = string.Empty;
            }
            if (row["Model"] != null && row["Model"] != DBNull.Value)
            {
                this.Model = (string)row["Model"];
            }
            else
            {
                this.Model = string.Empty;
            }
            if (row["EXFactory_ID"] != null && row["EXFactory_ID"] != DBNull.Value)
            {
                this.ExfactoryId = (string)row["EXFactory_ID"];
            }
            else
            {
                this.ExfactoryId = string.Empty;
            }
            if (row["ExFactory_Date"] != null && row["ExFactory_Date"] != DBNull.Value)
            {
                this.ExfactoryDate = (DateTime)row["ExFactory_Date"];
            }
            else
            {
                this.ExfactoryDate = DateTime.MinValue;
            }
            if (row["Producer"] != null && row["Producer"] != DBNull.Value)
            {
                this.Producer = (string)row["Producer"];
            }
            else
            {
                this.Producer = string.Empty;
            }
            if (row["Consign_Corp"] != null && row["Consign_Corp"] != DBNull.Value)
            {
                this.ConsignCorp = (string)row["Consign_Corp"];
            }
            else
            {
                this.ConsignCorp = string.Empty;
            }
            if (row["Deliver_Corp"] != null && row["Deliver_Corp"] != DBNull.Value)
            {
                this.DeliverCorp = (string)row["Deliver_Corp"];
            }
            else
            {
                this.DeliverCorp = string.Empty;
            }
            if (row["Tech_Condition"] != null && row["Tech_Condition"] != DBNull.Value)
            {
                this.TechCondition = (string)row["Tech_Condition"];
            }
            else
            {
                this.TechCondition = string.Empty;
            }
            if (row["Test_Outline"] != null && row["Test_Outline"] != DBNull.Value)
            {
                this.TestOutline = (string)row["Test_Outline"];
            }
            else
            {
                this.TestOutline = string.Empty;
            }
            if (row["Reg_Date"] != null && row["Reg_Date"] != DBNull.Value)
            {
                this.RegDate = (DateTime)row["Reg_Date"];
            }
            else
            {
                this.RegDate = DateTime.MinValue;
            }
            if (row["Rated_V"] != null && row["Rated_V"] != DBNull.Value)
            {
                this.RatedV = (decimal)row["Rated_V"];
            }
            else
            {
                this.RatedV = 0;
            }
            if (row["Rated_A"] != null && row["Rated_A"] != DBNull.Value)
            {
                this.RatedA = (decimal)row["Rated_A"];
            }
            else
            {
                this.RatedA = 0;
            }
            if (row["Resist_A"] != null && row["Resist_A"] != DBNull.Value)
            {
                this.ResistA = (decimal)row["Resist_A"];
            }
            else
            {
                this.ResistA = 0;
            }
            if (row["Apex_A"] != null && row["Apex_A"] != DBNull.Value)
            {
                this.ApexA = (decimal)row["Apex_A"];
            }
            else
            {
                this.ApexA = 0;
            }
            if (row["Commissary"] != null && row["Commissary"] != DBNull.Value)
            {
                this.Commissary = (string)row["Commissary"];
            }
            else
            {
                this.Commissary = string.Empty;
            }
            if (row["Create_Time"] != null && row["Create_Time"] != DBNull.Value)
            {
                this.CreateTime = (DateTime)row["Create_Time"];
            }
            else
            {
                this.CreateTime = DateTime.MinValue;
            }
            if (row["Update_Time"] != null && row["Update_Time"] != DBNull.Value)
            {
                this.UpdateTime = (DateTime)row["Update_Time"];
            }
            else
            {
                this.UpdateTime = DateTime.MinValue;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["Sample_ID"] = this.SampleId;
            row["Report_ID"] = this.ReportId;
            row["Ref_Par_File"] = this.RefParFile;
            row["Model"] = this.Model;
            row["EXFactory_ID"] = this.ExfactoryId;
            row["ExFactory_Date"] = this.ExfactoryDate;
            row["Producer"] = this.Producer;
            row["Consign_Corp"] = this.ConsignCorp;
            row["Deliver_Corp"] = this.DeliverCorp;
            row["Tech_Condition"] = this.TechCondition;
            row["Test_Outline"] = this.TestOutline;
            row["Reg_Date"] = this.RegDate;
            row["Rated_V"] = this.RatedV;
            row["Rated_A"] = this.RatedA;
            row["Resist_A"] = this.ResistA;
            row["Apex_A"] = this.ApexA;
            row["Commissary"] = this.Commissary;
            row["Create_Time"] = this.CreateTime;
            row["Update_Time"] = this.UpdateTime;
        }
        #endregion
    }
}
#endregion
